export function toast(title: string) {
  wx.showToast({
    title,
    icon: 'none',
    duration: 1500,
    mask: true
  });
}
export function to(url: string) {
  wx.navigateTo({ url });
}
export function log(res: any) {
  const logger = wx.getRealtimeLogManager();
  logger.info(res);
}
export function err(err: any) {
  const logger = wx.getRealtimeLogManager();
  logger.error(err);
}
export function back() {
  setTimeout(() => {
    var pages = getCurrentPages();
    var prePage = pages[pages.length - 2];
    wx.navigateBack({
      delta: 1,
      success: () => {
        prePage.onLoad();
      }
    });
  }, 1000);
}
export function scenes(e: string) {
  const decodeScene: string = decodeURIComponent(decodeURIComponent(e));
  const params = { mchId: '', deskId: '' };
  decodeScene.split('&').forEach((item: any) => {
    const arr = item.split('=');
    params[arr[0]] = arr[1];
  });
  return params;
}
export function get(string: string) {
  return uni.getStorageSync(string);
}
export function set(string: string, data: any) {
  uni.setStorageSync(string, data);
}
